<?php

namespace App\Admin\Resources;
use App\Admin\Models\SystemModel;

class WorshipBibleVolumeResource extends JsonResource
{
    public function toArray($request)
    {
        $data = SystemModel::getVirtualFields($this->getTable());
        foreach ($data as $key => $value) {
            unset($data[$key]);
            if (method_exists($this, $value)) {
                $data[$value] = $this->$value();
            }
        }
        return array_merge(parent::toArray($request),$data);
    }
}
